package com.atomos.strategy.action.display
{
	import flash.geom.Point;
	
	import com.atomos.particle.DisplayObjectParticle;
	import com.atomos.particle.Particle;
	import com.atomos.strategy.action.AbstractLifeTweenAction;	

	public class ScaleLifeTweenAction extends AbstractLifeTweenAction
	{
		protected var _pStartScale : Point;
		protected var _pEndScale : Point;
		
		public function ScaleLifeTweenAction( startScale : Point, endScale : Point, easing : Function = null )
		{
			super( 0, 1, easing );
			_pStartScale = startScale;
			_pEndScale = endScale;
		}
		override protected function _update( particle : Particle, value : Number ) : void
		{
			var p : DisplayObjectParticle = particle as DisplayObjectParticle;
			
			p.scale.x = _pStartScale.x + ( _pEndScale.x - _pStartScale.x ) * value; 
			p.scale.y = _pStartScale.y + ( _pEndScale.y - _pStartScale.y ) * value; 
		}	
	}
}